﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WenSkinTest.UserControlAll
{
    public partial class UserControlDataClass : WenSkin.Controls.WenUserControl
    {
        public UserControlDataClass():base()
        {
            InitializeComponent();
        }

        private void wenButton1_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("A");
            dt.Columns.Add("B");
            dt.Columns.Add("C");

            dt.Rows.Add("001", "001", "");
            dt.Rows.Add("002", "002", "001");
            dt.Rows.Add("003", "003", "001");
            dt.Rows.Add("004", "004", "");
            dt.Rows.Add("005", "005", "");
            dt.Rows.Add("006", "006", "005");
            dt.Rows.Add("007", "007", "006");
            dt.Rows.Add("008", "008", "006");

            wenDataGridView1.DataSource = dt;
            wenDataTextBox1.DataSource = dt.Rows[1];
            wenTreeView1.DataSource = dt;
            wenTreeViewColumn1.DataSource = dt;
            wenListBox1.DataSource = dt;
            wenListView1.DataSource = dt;
        }

        private void wenDataGridView1_DataGridViewRowCheckBoxClick(object sender, WenSkin.Controls.WenDataGridView.DataGridViewRowCheckBoxEventArgs e)
        {
            this.MsgBoxInformation($"第{e.RowIndex + 1}行被点击了");
        } 

        private void wenDataTextBox1_ButtonClick(object sender, EventArgs e)
        {
            this.MsgBoxInformation($"数据库语句生成器\r\n\r\n插入:{wenDataTextBox1.InsertSqlString}\r\n\r\n更新：{wenDataTextBox1.UpdateSqlString}");
        }
    }
}
